/*******************************************************************************
* This header contains auxiliary procedures.
* 
*
* Licensed under GPL Version 3 license (/license.txt).
* Author: Eder A. Perez (eder.perez@ice.ufjf.br)
*******************************************************************************/

#ifndef __CV_AUX_H__
#define __CV_AUX_H__

/*******************************************************************************/
/* Macros                                                                      */
/*******************************************************************************/  

// Return the length of a image scanline in bytes (including padding, if it exists)
#define ROWSIZE(width, bpp) ( ((((width) * (bpp)) + 31) & ~31) >> 3 )

// Swap two variables (it works for primitive variables)
#define SWAP(a, b) (((a) ^ (b)) && ((b) ^= (a) ^= (b), (a) ^= (b)))

#endif
